package view;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import controller.CommandLineListener;

public class CommandLineBar extends JPanel{
	
	private static final long serialVersionUID = 1L;
	
	@SuppressWarnings("rawtypes")
	public CommandLineBar() {		
		
		setLayout(new GridBagLayout());
		GridBagConstraints cc = new GridBagConstraints();	
		
		volumeName = new JLabel();
		volumeName.setHorizontalAlignment(JTextField.RIGHT);		
		commandLine = new JComboBox ();
		commandLine.setEditable(true);		
		commandLine.addActionListener(new CommandLineListener(volumeName));

		cc.fill = GridBagConstraints.HORIZONTAL ;  
		cc.gridx = 0;
		cc.ipadx = 10;
        cc.gridy = 0;
        cc.weightx = 0.3;  
        add(volumeName,cc); 
        
        
        cc.fill = GridBagConstraints.HORIZONTAL ;  
		cc.gridx = 1;
        cc.gridy = 0;
        cc.weightx = 0.7;  
        add(commandLine,cc); 	
	
	}	
	
	public void setVolumeName(String name) {
		volumeName.setText(name);		
	}
	
	public void updateNames(){}	
	@SuppressWarnings("rawtypes")
	private JComboBox  commandLine;
	private JLabel volumeName;
	
}